// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI)
Vue.config.productionTip = false

import VueRouter from 'vue-router'

Vue.use(VueRouter)

//配置全局路由
//1.引入组件
import RoleList from "./components/rolemgr/RoleList.vue"
import UserList from "./components/usermgr/UserList.vue"

//2.定义路由配置
const routes = [
  {
    path:"/userlist", //路径，理解为a连接里面的www.baidu.com
    component:UserList  // 组件，相当于百度的服务器
  },{
    path:"/rolelist", //路径，理解为a连接里面的www.baidu.com
    component:RoleList  // 组件，相当于百度的服务器
  }
]
//3.创建一个路由对象
const router = new VueRouter({
  routes,
  "mode": "history"  //锚点
})
new Vue({
  router,
  el: '#app',
  components: {
    App,
    RoleList,
    UserList
  },
  template: '<App/>'
})
